package com.ruima.erp.framework.rest;

import java.sql.SQLException;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import net.sf.json.JSONArray;
import net.sf.json.JsonConfig;

import com.ruima.erp.framework.db.impl.RmSysRoleUserImp;
@Path("RmSystemResRoleService")
public class RmSystemResRoleService {
	private static String SYSTEM_RES_ROLE_JSON;
	private RmSysRoleUserImp rmSysRoleUserImp = new RmSysRoleUserImp();
	
	
	@GET
	@Produces(MediaType.TEXT_HTML)
	@Path("getrmsysroleuserlist")
	public String getRmSysRoleUserList(){
		try {
			if(SYSTEM_RES_ROLE_JSON==null){
				JsonConfig jc = new JsonConfig();
				jc.setExcludes(new String[]{});
				SYSTEM_RES_ROLE_JSON = JSONArray.fromObject(rmSysRoleUserImp.getRmSysRoleUser(),jc).toString();
			}
			return "{\"identifier\":\"objid\",\"label\":\"objid\",\"items\":"+SYSTEM_RES_ROLE_JSON+"}";
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return "{\"result\":0}";
	}
	public static void main(String[] args) {
		new RmSystemResRoleService().getRmSysRoleUserList();
		
	}
}
